
package com.app.bimo.module_accounts.mvp.model.model;


import com.app.bimo.commonbusiness.bean.BaseResult;
import com.app.bimo.commonbusiness.network.RetrofitServiceManager;
import com.app.bimo.library_db.UserData;
import com.app.bimo.module_accounts.BuildConfig;
import com.app.bimo.module_accounts.mvp.constract.PreferenceContract;
import com.app.bimo.module_accounts.mvp.model.api.service.AccountService;
import com.app.bimo.module_accounts.mvp.model.entiy.PreferenceData;

import java.util.List;

import io.reactivex.Observable;

public class PreferenceUserModel implements PreferenceContract.Model {


    @Override
    public void onDestroy() {

    }


    @Override
    public Observable<BaseResult<List<PreferenceData>>> getPre(int channel) {
        return RetrofitServiceManager.getInstance().createRetrofit(BuildConfig.APPLICATION_ID, AccountService.class).getPre(channel);
    }

//    @Override
//    public Observable<BaseResult<Object>> setPre(int channel, String categoryids) {
//        return null;
//    }

    @Override
    public Observable<BaseResult<Object>> setPre(int channel, String categoryids, int isRegiest) {
        return RetrofitServiceManager.getInstance().createRetrofit(BuildConfig.APPLICATION_ID, AccountService.class).setPre(channel,categoryids,isRegiest);

    }
    @Override
    public Observable<BaseResult<UserData>> getUserInfo() {
        return RetrofitServiceManager.getInstance().createRetrofit(BuildConfig.APPLICATION_ID, AccountService.class).getUserInfo();

    }
}
